﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using nwrole.toolbox.sync;

namespace sync_test.maps
{
    public class OBJEKTSBUNDET_OLD
    {
        public static SyncMap Mapping
        {

              get
            {
                var map = new SyncMap();

                map.Name = "FastOBJEKTSBUNDET";
                map.SourceTableName = "wf.OBJEKTSBUNDET";
                map.ShadowTableName = "jfh_bo.OBJEKTSBUNDET_GHOST";
                map.DestinationTableName = "int_OBJEKTSBUNDET";

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "OBJEKTSBUNDETID",
                        CSharpType = "System.Decimal",
                        PrimaryKey = true,
                        SourceSqlTypeName = "INTEGER",
                        SourceSqlTypeNullableBool = false,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = false,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "OBJEKTID",
                        CSharpType = "System.Decimal",
                        SourceSqlTypeName = "INTEGER",
                        SourceSqlTypeNullableBool = false,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = false,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "HYRESDELID",
                        CSharpType = "System.Decimal",
                        SourceSqlTypeName = "INTEGER",
                        SourceSqlTypeNullableBool = false,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = false,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "INDEXTALID",
                        CSharpType = "System.Decimal",
                        SourceSqlTypeName = "INTEGER",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = true,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "IND_INDEXTALID",
                        CSharpType = "System.Decimal",
                        SourceSqlTypeName = "INTEGER",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = true,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "FROMDAT",
                        CSharpType = "System.DateTime",
                        SourceSqlTypeName = "DATE",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "datetime2(7)",
                        DestSqlTypeNullableBool = true,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "TOMDAT",
                        CSharpType = "System.DateTime",
                        SourceSqlTypeName = "DATE",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "datetime2(7)",
                        DestSqlTypeNullableBool = true,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "BELOPP",
                        CSharpType = "System.Decimal",
                        SourceSqlTypeName = "NUMBER(12,2)",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "decimal(12,2)",
                        DestSqlTypeNullableBool = true,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "NYBELOPP",
                        CSharpType = "System.Decimal",
                        SourceSqlTypeName = "NUMBER(12,2)",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "decimal(12,2)",
                        DestSqlTypeNullableBool = true,
                    }

                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "NYBELOPPFROM",
                        CSharpType = "System.DateTime",
                        SourceSqlTypeName = "DATE",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "decimal(12,2)",
                        DestSqlTypeNullableBool = true,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "INDEXANDEL",
                        CSharpType = "System.Decimal",
                        SourceSqlTypeName = "NUMBER(12,2)",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "decimal(12,2)",
                        DestSqlTypeNullableBool = true,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "TEXT",
                        CSharpType = "System.String",
                        SourceSqlTypeName = "VARCHAR2(80 BYTE)",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "nvarchar(80)",
                        DestSqlTypeNullableBool = true,
                    }
                );

                return map;
            }
        }
    }
}

/*
 var map2 = new SyncMap()
            {
                SourceTableName = "V_Bo_Objekt_Hyra",
                ShadowTableName = "V_Bo_Objekt_Hyra",
                Columns = new List<SyncMapColumn>() {
                    new SyncMapColumn() {
                        ColumnName = "objektid",
                        PrimaryKey = true
                    },
                    new SyncMapColumn() {
                        ColumnName = "objektsbundetid",
                    },
                    new SyncMapColumn() {
                        ColumnName = "belopp",
                    },
                    new SyncMapColumn() {
                        ColumnName = "fromdat",
                    },
                    new SyncMapColumn() {
                        ColumnName = "hyredel",
                    },
                    new SyncMapColumn() {
                        ColumnName = "periodbelopp",
                    },
                    new SyncMapColumn() {
                        ColumnName = "tomdat",
                    },
                }
            };

*/